﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Inspector.Modules
{
    public partial class Security : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void dropSelector_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var list = new List<string>();
                list.AddRange(new string[]{
            "Win32_SystemUsers",
            "Win32_Account",
            "Win32_AccountSID",
            "Win32_SecurityDescriptor",
            "Win32_SecuritySetting",
            "Win32_SecuritySettingAccess",
            "Win32_SecuritySettingAuditing",
            "Win32_SecuritySettingGroup",
            "Win32_SecuritySettingOfLogicalFile",
            "Win32_SecuritySettingOfLogicalShare",
            "Win32_SecuritySettingOfObject",
            "Win32_SecuritySettingOwner",
            "Win32_NTEventlogFile",
            "Win32_NTLogEvent",
            "Win32_NTLogEventComputer",
            "Win32_NTLogEventLog",
            "Win32_NTLogEventUser"});
                foreach (var item in list)
                {
                    dropSelector.Items.Add(new ListItem(item, item));
                }
            }
        }

        protected void dropSelector_SelectedIndexChanged(object sender, EventArgs e)
        {
            mainGrid.DataSource = InspectorUtils.GetMachineProperties(dropSelector.SelectedValue);
            mainGrid.DataBind();
        }
    }
}